using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;
/*
 * There are many processes that handle the flows of data
 * we call them business logic of a program.
 * For each of business logic process we create a class 
 * that handle for that process
 * 
 * */
namespace BaHuan.BusinessLayer
{
	
	public class MuaHangManagement
	{	
		public ResultObj SaveNewMuaHang(MuaHang muahang)
        		{
			ResultObj result = new ResultObj();
			muahang.Id = -1;
			MuaHangDAO muahangDAO = new MuaHangDAO();
			result = muahangDAO.SaveMuaHang(muahang);
			
			return result;
		}
		
		public ResultObj UpdateMuaHang(MuaHang muahang)
        		{
			ResultObj result = new ResultObj();
			MuaHangDAO muahangDAO = new MuaHangDAO();
			result = muahangDAO.SaveMuaHang(muahang);
			
			return result;
		}
		
		public ResultObj DeleteMuaHang(MuaHang muahang)
        		{
			ResultObj result = new ResultObj();
			MuaHangDAO muahangDAO = new MuaHangDAO();
			result = muahangDAO.DeleteMuaHang(muahang);
			
			return result;
		}
		
		public ResultObj GetAllMuaHang()
        		{
			ResultObj result = new ResultObj();
			MuaHangDAO muahangDAO = new MuaHangDAO();
			result = muahangDAO.GetAllMuaHang();
			
			return result;
		}
		
		public ResultObj GetMuaHangById(MuaHang muahang)
        		{
			ResultObj result = new ResultObj();
			MuaHangDAO muahangDAO = new MuaHangDAO();
			result = muahangDAO.GetAllMuaHangByID(muahang);
			
			return result;
		}

        public ResultObj GetMuaHangByMaSo(MuaHang muahang)
        {
            ResultObj result = new ResultObj();
            MuaHangDAO muahangDAO = new MuaHangDAO();
            result = muahangDAO.GetAllMuaHangByMaSo(muahang);

            return result;
        }					
	}
}
